package com.example.excelimport.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.example.excelimport.entity.User;

// 行数统计监听器
public class RowCountListener extends AnalysisEventListener<User> {
    private int rowCount = 0;

    @Override
    public void invoke(User user, AnalysisContext context) {
        rowCount++;
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        // 解析完成
    }

    public int getRowCount() {
        return rowCount;
    }
}
